﻿using Com.OpenCode.Framework.Core;
using DevExpress.XtraBars;

namespace Com.OpenCode.Framework.DevForm
{
    /// <summary>
    ///     右键菜单。
    /// </summary>
    public class RightMenuUI : OpenCodeRightMenuUI, IRightMenuProperty
    {
        public RightMenuUI(BuildItemEventArgs args)
        {
            Manager = args.Owner as BarManager;
            args.Plugin.Owner = this;
            OwnerRightMenu = this;
        }

        public OpenCodeRightMenuUI OwnerRightMenu { get; set; }
        public bool BeginGroup { get; set; }

        public void Add(BarItem item)
        {
            item.Manager = Manager;
            AddItem(item).BeginGroup = BeginGroup;
        }

    }
}